<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<title>WORD</title>
</head>
<script>
var i_p_l = 1;
var i=0;
var j=1;
var Matrix = [
			  [ ' wholly ' , ' all ' , ' some ' ] ,
[ ' overhaul ' , ' modernizing ' , ' modernizing has not ant ' ] ,
[ ' farm ' , ' farms ' , ' farms has not ant ' ] ,
[ ' social_welfare ' , ' welfare ' , ' ill-being ' ] ,
[ ' department ' , ' Department ' , ' Department has not ant ' ] ,
[ ' postdate ' , ' follow ' , ' precede ' ] 
			  ];

function Up_Click(){
	if(i==0);
	else {
		i_p_l==1;
		i--;j=1;
		change_src(i,j)}
}
function Down_Click(){
	if(i==Matrix.length-1);
	else {
		i_p_l==1;
		i++;j=1;
		change_src(i,j)}
}
function Syn_Click(){
	if(i_p_l==0){j=1;i_p_l=1}
	else {j=0;i_p_l=0}
	change_src(i,j);
}
function Ant_Click(){
	if(i_p_l==0){j=1;i_p_l=1}
	else {j=2;i_p_l=0}
	change_src(i,j);
}
function Jump_Click(){
	var jump_i = document.getElementById("jump_i_text").value;
	i=parseInt(jump_i);
	if(0<=i&&i<Matrix.length){
		j=1;
		change_src(i,j);}
	else alert('输入错误或者超标')
}
function change_src(i,j)
	{document.getElementById("iframepage").src=
	"http://image.baidu.com/search/index?tn=baiduimage&ps=1&ct=201326592&lm=-1&cl=2&nc=1&ie=utf-8&word="+Matrix[i][j];
	}
function changeFrameHeight(){
    document.getElementById("iframepage").height=document.documentElement.clientHeight-56;
    }
window.onresize=function(){ changeFrameHeight();}
$(function(){changeFrameHeight();});
</script>


<body>
  <input name="Up_Button" type="button" id="Up_Button" onclick="Up_Click()" value="Previous" />
   <input name="Down_Button" type="button" id="Down_Button" onclick="Down_Click()" value="Next" /> 
   <input name="Syn_Button" type="button" id="Syn_Button" onclick="Syn_Click()" value="Syn" />
    <input name="Ant_Button" type="button" id="Ant_Button" onclick="Ant_Click()" value="Ant" />
	
	<input type="text" id="jump_i_text" value="" />
	<input name="Jump_Button" type="button" id="Jump_Button" onclick="Jump_Click()" value="Jump" />
    <iframe src="http://image.baidu.com"
	 id="iframepage" name="iframepage" frameBorder=0 scrolling=auto width="100%" height="100%"
			onload="changeFrameHeight()" ></iframe>
</body>
<script>
	change_src(i,j);
	document.getElementById('jump_i_text').value='最小值0，最大值'+(Matrix.length-1).toString()
</script>
</html>
